1. Field of the Invention
The present invention relates to a rewritable optical recording medium and more particularly, to a method for real time recording/playback of data to/from an optical recording medium and a method for managing a file thereof.
2. Background of the Related Art
An optical recording medium includes a Read Only memory (ROM), a Write Once Read Many (WORM) time memory, and a rewritable memory which allows repeated writing. The ROM type of optical recording medium further includes a Compact Disc Read Only Memory (CD-ROM) and a Digital Versatile Disc Read Only Memory (DVD-ROM). The WORM type of optical recording medium further includes a Recordable Compact Disc (CD-R) and a Recordable Digital Versatile Disc (DVD-R). The rewritable type further includes a Rewritable Compact Disc (CD-RW) and a Rewritable Digital Versatile Disc (DVD-RW, DVD-RAM and DVD+RW).
For the rewritable optical recording mediums, the repeated recording and playback (R/P) of information to and from the rewritable optical recording medium changes an initial mixture ratio of a recording layer formed to write data on the optical disk. This change degrades performance of the optical recording medium, causing errors in R/P of the data information. A degraded region of an optical disk creates a defective area for formatting, writing to and playback from the optical recording medium. Moreover, a defective area in a rewritable optical recording medium can also be caused by scratches on the surface, dusts and defects in production.
To prevent R/P of data to/from a defective area formed by any of the above causes, management of the defective area is required. Thus, Defect Management Areas (DMAs) are provided in lead-in areas and in lead-out areas of the optical recording medium for managing defective regions of the optical recording medium, as shown in FIG. 1. Also, a data area is managed in groups, each having a user area for actual recording of data and a spare area for use in a case of defect in the user area.
Typically, one disc (e.g. DVD-RAM) has four DMAs, two in the lead-in area and two in the lead-out area. Since managing defect areas is important, the same data are held in all four DMAs, for data protection. Each DMA includes two blocks of 32 sectors, wherein one block consists of 16 sectors. The first block (DDS/PDL block) of each DMA includes a disc definition structure (DDS) and a primary defect list (PDL), and the second block (SDL block) includes a secondary defect list (SDL).
More specifically, the PDL represents a primary defect data storage area, and the SDL represents a secondary defect data storage area. The PDL stores entries of all defective sectors generated during manufacture and identified during formatting such as initialization or re-initialization. Each entry includes a sector number corresponding to a defective sector and an entry type.
On the other hand, the SDL is arranged by blocks and stores entries of either defective areas which may be generated after initialization, or defective areas which cannot be entered in the PDL during initialization. Each entry of the SDL includes an area storing the sector number of a first sector of the block having a defective sector, and an area holding the sector number of a first sector of an alternate block. Defective areas in the data area (i.e. defective sectors or defective blocks) are replaced with new sectors or blocks, respectively by slipping replacement or linear replacement.
The slipping replacement is utilized when a defective area or sector is listed in the PDL. As shown in FIG. 2A, if defective sectors m and n, corresponding to sectors in the user area, are recorded in the PDL, such defective sectors are replaced by the next available sector. By replacing the defective sectors by subsequent sectors, data is written to a normal sector. As a result, the user area into which data is written slips and occupies the spare area in the amount equivalent to the defective sectors.
The linear replacement is utilized when a defective area or block is recorded in the SDL. As shown in FIG. 2B, if defective sectors m and n, corresponding to sectors in either the user or spare area, are recorded on the SDL, such defective blocks are replaced by normal blocks in the spare area and the data to be recorded in the defective block are recorded in an assigned spare area. To achieve the replacement, a physical sector number (PSN) assigned to a defective block remains, while a logical sector number (LSN) is moved to the replacement block along with the data to be recorded. Linear replacement is effective for non real-time processing of data.
FIG. 3 is partial diagram of an optical disc recording/playback device relating to the write operation. The optical disc R/P device includes an optical pickup to write data into and playback data from the optical disc; a pickup controller transferring or moving the optical pickup; a data processor either processing and transferring the input data to the optical pickup, or receiving and processing the data reproduced through the optical pickup; an interface and a micro processor (micom) controlling the components.
Also, a host may be connected to the interface of the optical disc R/P device to transfer commands and data to and from the host and R/P device. Such a host can be any kind of personal computer, and would manage the optical disc R/P device.
Referring to FIG. 3, when data to be written is provided, the host provides a write command to the device for R/P of the data to/from an optical recording medium. The write command is inclusive of a Logical Block Address (LBA) which designates a writing position and a transfer length providing the size of the data. The host then provides the data to be written to the device for RIP of data to/from an optical recording medium. Upon reception of the data, the device for R/P of data writes the data starting from the designated LBA. At this time, the R/P device does not write data on defective areas, utilizing the PDL and the SDL which indicate defects on the optical recording medium.
Namely, the physical sectors listed on the PDL are skipped during the writing. As shown in FIG. 4A, physical blocks sblkA and sblkB listed on the SDL are replaced with replacement blocks sblkC and sblkD assigned to the spared area in the writing. Also, during the writing or playback of data, if a defective block not listed on the SDL or a block with a high possibility of error occurrence is present, the block is regarded as a defective block. Thus, a replacement block is located in the spare area, data of the defective block is written again into the replacement block, and a first sector number of the defective block and a first sector number of the replacement block are listed on the SDL entry.
Referring to FIG. 4A, for file 1, a conceptual expression of a portion representing a starting position and a size of file in an Information Control Block (ICB) having the file information written thereon in an Universal Disc Format (UDF) file may be shown as in FIG. 4B. As file 1 starts from position ‘A’, a defective block sblkB in file 1 is replaced with a spare block sblkD in the spare area. Thus, the number of logical sectors remains and a size of sector for file 1 is ‘N’.
In order to write data by replacing defective blocks listed on the SDL with a replacement block assigned in the spare area, the optical pickup must be shifted to the spare area and returned back to the user area. However, the time period required for shifting and returning back interferes with a real time recording. Accordingly, many defective area management methods for real time recording are suggested. One of such methods is a skipping method in which the linear replacement is not performed when using the SDL, but data of an encountered defective block is written on a good block subsequent to the defective block as in the slipping replacement. As a result, the shifting time of the optical pickup in a real time recording can be reduced because the optical pickup is not required to shift to the spare area every time the optical pickup encounters a defective block.
At this time, the defective block retains the LSN and PSN. However, from the viewpoint of the host, the number of logical sectors in an optical disc is fixed. Thus, skipping causes losses of LSN in view of the host, equivalent to the number of skipped blocks, because LSNs are allocated to the skipped defective blocks even if data is not written on the defective block. For example, even if data of 100 sectors are transmitted for writing from the host and if there is one defective block in the area, only 84 sectors (1 block=16 sectors) are written.
Therefore, for file 1 in FIG. 4C, the size can be represented as N or N-L, shown in FIG. 4D, in an ICB of a UDF file system. The ‘L’ denotes a number of defective sectors skipped in an area on which file 1 is written. As shown in FIG. 4C, data of file 1 is written from position ‘A’ for ‘M’ sectors until a defective block is encountered. The defective block is skipped, and the writing of file 1 is continued. However, since the defective block sblkB retains the LSN without writing data on the defective block sblkB, the optical disk R/P device writes data only on N-L sectors when the host provides a command to write data on N sectors, because the LSN of the defective block sblkB cannot be used.
Consequently, if file 1 size is represented with ‘N’ as in the first case of FIG. 4D, an actual file size and a written file size differs, causing a problem in management of the file by a file manager. On the other hand, if the size of file 1 is represented with ‘N-L’ as in the second case, an inconsistency of the LSNs occurs. For example, if file 3 is newly written after file 2 in FIG. 4C has been erased, the file manager of the host would generate a command to write the data of file 3 starting from C-L position, where L is the number of sectors with defects. As a result, data of file 1, previously written, would be damaged. Thus, when a real time data is written according to the aforementioned method, the file manager can make mistakes in the management of the files.
Also, the LSNs retained by the defective areas during a real time recording cannot be utilized and an amount of data corresponding to such LSNs cannot be recorded. Therefore, effectively, a reduction of the disk size occurs. This is because data is written in fixed units in response to write command from the host regardless of whether defective blocks or defective sectors exists in an area in which the data is written.